<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>实验室员工</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true"  layout="table" tiptype="3" >
		<input id="id" name="id" type="hidden" value="${item.id }">
 		<table style="" cellpadding="0" cellspacing="1" class="formtable"> 
					
				<tr>
					<td align="right">
						<label class="Validform_label">
							选择消耗品:
						</label>
					</td>
					<td class="value"> 
                	     <input id="meterialId" name="meterialId" type="hidden"  value='${item.consumeMeterial.id }'>               
					     <input id="meterialName"  type="text" style="width: 150px" class="inputxt" 
					      readonly="readonly" datatype="*" value='${item.consumeMeterial.name}'>
					     <t:choose hiddenName="meterialId" hiddenid="id" url="consumeMeterialDictController.do?goSelect" name="meterialList"
                          icon="icon-search" title="选择" textname="name" inputTextname="meterialName" isclear="false" isInit="true" ></t:choose>
							
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">消耗品</label>
						
					</td>
					
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							数量:
						</label>
					</td>
					<td class="value">
					     <input id="count" name="count" type="text"  value="${item.count }" datatype="*"
					     	style="width: 150px" class="inputxt"   maxlength="10"  onkeypress="numberValidate()">
					     <span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">数量</label>
  					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							总金额:
						</label>
					</td>
					<td class="value">
					     <input id="amount" name="amount" type="text"  value="${item.amount }" datatype="*"
					     	style="width: 150px" class="inputxt"   maxlength="10"  >
					     <span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">总金额</label>
  					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							备注:
						</label>
					</td>
					<td class="value">
					    <textarea id="remark" name="remark" type="text"  
					     style="width: 250px;height:80px;" class="inputxt"   maxlength="300"  >${item.remark }</textarea>
  					</td>
				</tr>
			</table>
		</t:formvalid>
		<script>
	 
		
		$(document).ready(function(){ 
			moneyValidate('amount');
			
			var id = $('#id').val();
			if(id.length < 10 && W.currentModObj != undefined){ //修改未保存的信息，需要从内存中读取
				var modObj = W.currentModObj;
 				$('#id').val(modObj.id);
				$('#meterialId').val(modObj.meterialId);
				$('#meterialName').val(modObj.meterialName);
				$('#count').val(modObj.count);
				$('#amount').val(modObj.amount);
				$('#remark').val(modObj.remark);	
 			}
		});
		
		//根据form表单内容，获取staff对象
		function getMeterial(){ 
			var id = $('#id').val();
			var meterialId = $('#meterialId').val();
			var meterialName = $('#meterialName').val();
			var count = $('#count').val();
			var amount = $('#amount').val(); 
			var remark = $('#remark').val();
			
			if(meterialId ==''){
				tip('请选择耗材');
				return null;
			}
			if(count ==''){
				tip('请填写数量');
				return null;
			}
			if(amount ==''){
				tip('请填写金额');
				return null;
			}
			
			var meterial = {
					meterialId:meterialId,
					meterialName:meterialName,
					id:id,
					count:count,
					amount:amount,
					remark:remark
			}
		
			return meterial;
		}
		</script>
 </body>
 